"use strict";

var _regenerator = require("babel-runtime/regenerator");

var _regenerator2 = _interopRequireDefault(_regenerator);

var _asyncToGenerator2 = require("babel-runtime/helpers/asyncToGenerator");

var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

//@charset "utf-8"
/**
 * 建立replaceAll 全部替换函数
 * @param type string strFrom 搜索需要替换的字符
 * @param type string strTo 替换成什么
 */
String.prototype.replaceAll = function (strFrom, strTo) {
	return this.replace(new RegExp(strFrom, 'gm'), strTo);
};

/**
 * 统一调用客户端接口
 *
 * @author	汪平平<wangpingping@myhexin.com>
 * @create	2014/12/06
 * @dependence	原生js，不依赖其他js框架
 * @notic
 */
function ComClientInterface() {
	//方法不存在提示
	this.noenvironment = "the client environment does not exist!";

	/**
  * 设置预警添加接口数据格式
  */
	//设置预警参数格式 content传递的是json样式的字符串[{},{},{},{}]
	this.setSubTemplateData = {
		"mobileid": "",
		"pcid": "",
		"code": "",
		"content": ""
	};
	//设置预警参数里 每项条件的参数格式，最终所有条件存入数组
	this.setSubEveryTempData = '{"mobileid":"","pcid":"","datainfo":';
	this.setSubEveryTempData += '{"type":"2","stockcode":"","stockname":"","market":"","userid":"","templates":"","value":"","mode":""},';
	this.setSubEveryTempData += '"platform":"pc",';
	this.setSubEveryTempData += '"appname":"hexin"}';

	this._init.apply(this, arguments);
}

ComClientInterface.prototype = {
	_init: function _init(options) {
		options = options || {};
		//客户端以及手机端标识
		this.mobileid = options.mobileid || '';
		this.pcid = options.pcid || '';

		//单次操作的股票代码以及名称
		this.stockcode = options.stockcode || '';
		this.stockname = options.stockname || '';

		this.setSubTemplateData['mobileid'] = this.mobileid;
		this.setSubTemplateData['pcid'] = this.pcid;
		//this.setSubTemplateData['code'] = this.stockcode;

		//设置预警的数据，json格式
		this.setSubData = new Array();

		//错误标记为空
		this.error = false;
		this.errormsg = '';
		//警告标记为空
		this.waring = false;
		this.waringmsg = '';

		try {
			this.clientUtil = new ThsUtil();
			this.fis = new ThsFileReader();
			this.fos = new ThsFileWriter();
			return true;
		} catch (e) {
			return this._error(this.noenvironment);
		}
	},
	_throw: function _throw() {
		//抛出内容
		if (typeof console !== 'undefined') {
			if (arguments.length == 1) {
				console.log(arguments[0]);
			} else if (arguments.length > 1) {
				console.log(arguments);
			}
		} else {
			if (arguments.length == 1) {
				alert(arguments[0]);
			} else if (arguments.length > 1) {
				for (var i = 0; i < arguments.length; i++) {
					alert("第" + (i + 1) + "个输出：" + arguments[i]);
				}
			}
		}
	},
	_error: function _error(msg) {
		this._throw(msg);

		this.error = true;
		this.errormsg = msg;

		return false;
	},
	_waring: function _waring(msg) {
		this._throw(msg);

		this.waring = true;
		this.waringmsg = msg;
	},
	getErrorMsg: function getErrorMsg() {
		return this.errormsg;
	},
	getWaringMsg: function getWaringMsg() {
		return this.waringmsg;
	},

	/**
  * 设置预警条件
  * @param string param 预警设置的项
  * @param string value 预警设置项的值
  */
	decToHex: function decToHex(str) {
		var res = [];
		for (var i = 0; i < str.length; i++) {
			res[i] = ("00" + str.charCodeAt(i).toString(16)).slice(-4);
		}return "\\u" + res.join("\\u");
	},
	formatSetSubData: function formatSetSubData(param, value, mode, market, pcid, mobileid) {
		var subscribeData = this.setSubEveryTempData;
		param = param || '';
		value = value || '';
		mode = mode || '';
		market = market || '';
		pcid = pcid || '';
		mobileid = mobileid || '';
		if (param != '' && value != '') {
			var stockNameUni = this.decToHex(this.stockname);
			subscribeData = subscribeData.replaceAll('"stockcode":""', '"stockcode":"' + this.stockcode + '"');
			subscribeData = subscribeData.replaceAll('"stockname":""', '"stockname":"' + stockNameUni + '"');
			subscribeData = subscribeData.replaceAll('"templates":""', '"templates":"' + param + '"');
			subscribeData = subscribeData.replaceAll('"market":""', '"market":"' + market + '"');
			subscribeData = subscribeData.replaceAll('"value":""', '"value":"' + value + '"');
			subscribeData = subscribeData.replaceAll('"mode":""', '"mode":"' + mode + '"');
			if (pcid != '') {
				subscribeData = subscribeData.replaceAll('"pcid":""', '"pcid":"' + pcid + '"');
			} else if (mobileid != '') {
				subscribeData = subscribeData.replaceAll('"mobileid":""', '"mobileid":"' + mobileid + '"');
			}
		}
		//alert(subscribeData+"aaaaaaaaa");
		this.setSubData.push(subscribeData);
	},
	//调用设置预警接口
	postSetSubData: function () {
		var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(pcc) {
			var postSetData, truestr, time;
			return _regenerator2.default.wrap(function _callee$(_context) {
				while (1) {
					switch (_context.prev = _context.next) {
						case 0:
							postSetData = this.setSubTemplateData;

							pcc = pcc || '';
							postSetData['content'] = '[' + this.setSubData.join(',') + ']';
							// alert('post'+postSetData['content']);
							_context.next = 5;
							return this.clientUtil.setAlertCfg(postSetData);

						case 5:
							truestr = _context.sent;

							if (truestr == true) {
								if (pcc != '') {
									/*$(".kinds_tip").html('修改成功！');
               $(".kinds_tip").fadeIn(500);
               clearTimeout(time);
               var time = setTimeout(function(){
                  $(".kinds_tip").fadeOut(500);
               },800);*/
								} else {
									$(".kinds_tip").html('设置成功！');
									$(".kinds_tip").fadeIn(500);
									clearTimeout(time);
									time = setTimeout(function () {
										var external = new ThsExternal();
										external.closeWindow();
										$(".kinds_tip").fadeOut(500);
									}, 800);
								}
							} else {
								$(".kinds_tip").html('设置失败！');
								$(".kinds_tip").fadeIn(500);
								clearTimeout(time);
								time = setTimeout(function () {
									$(".kinds_tip").fadeOut(500);
								}, 800);
							}

						case 7:
						case "end":
							return _context.stop();
					}
				}
			}, _callee, this);
		}));

		function postSetSubData(_x) {
			return _ref.apply(this, arguments);
		}

		return postSetSubData;
	}(),

	/**
  * 获取客户端预警条件
  * @param string code 股票代码
  */
	getSubData: function () {
		var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(code, market) {
			var thisClientInfo;
			return _regenerator2.default.wrap(function _callee2$(_context2) {
				while (1) {
					switch (_context2.prev = _context2.next) {
						case 0:
							code = code || '';
							market = market || '';
							thisClientInfo = { 'mobileid': '', 'pcid': '', 'code': code, 'market': market };

							if (!(code == '')) {
								_context2.next = 7;
								break;
							}

							_context2.next = 6;
							return this.clientUtil.getAlertCfg();

						case 6:
							return _context2.abrupt("return", _context2.sent);

						case 7:
							_context2.next = 9;
							return this.clientUtil.getAlertCfg(thisClientInfo);

						case 9:
							return _context2.abrupt("return", _context2.sent);

						case 10:
						case "end":
							return _context2.stop();
					}
				}
			}, _callee2, this);
		}));

		function getSubData(_x2, _x3) {
			return _ref2.apply(this, arguments);
		}

		return getSubData;
	}(),

	/**
  * 获取预警结果内容获取第M-N条结果//M<=N 且，M,N 以0为起始序号
  */
	getSubResult: function () {
		var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3() {
			return _regenerator2.default.wrap(function _callee3$(_context3) {
				while (1) {
					switch (_context3.prev = _context3.next) {
						case 0:
							_context3.next = 2;
							return this.clientUtil.getAlertResult({
								'start': M,
								'end': N
							});

						case 2:
							return _context3.abrupt("return", _context3.sent);

						case 3:
						case "end":
							return _context3.stop();
					}
				}
			}, _callee3, this);
		}));

		function getSubResult() {
			return _ref3.apply(this, arguments);
		}

		return getSubResult;
	}(),
	/*获取本地文件的内容*/
	getFileContent: function () {
		var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(file) {
			var external, userPath, str;
			return _regenerator2.default.wrap(function _callee4$(_context4) {
				while (1) {
					switch (_context4.prev = _context4.next) {
						case 0:
							external = new ThsExternal();
							_context4.next = 3;
							return external.getUserPath();

						case 3:
							userPath = _context4.sent;

							if (!(null === this.fis)) {
								_context4.next = 6;
								break;
							}

							return _context4.abrupt("return", false);

						case 6:
							str = false;
							_context4.next = 9;
							return this.fis.open(userPath + file);

						case 9:
							if (!_context4.sent) {
								_context4.next = 20;
								break;
							}

							_context4.prev = 10;
							_context4.next = 13;
							return this.fis.read();

						case 13:
							str = _context4.sent;
							_context4.next = 18;
							break;

						case 16:
							_context4.prev = 16;
							_context4.t0 = _context4["catch"](10);

						case 18:
							_context4.next = 20;
							return this.fis.close();

						case 20:
							if (!(false === str)) {
								_context4.next = 22;
								break;
							}

							return _context4.abrupt("return", false);

						case 22:
							return _context4.abrupt("return", eval('(' + str + ')'));

						case 23:
						case "end":
							return _context4.stop();
					}
				}
			}, _callee4, this, [[10, 16]]);
		}));

		function getFileContent(_x4) {
			return _ref4.apply(this, arguments);
		}

		return getFileContent;
	}(),
	/*写入文件*/
	writeFileContent: function () {
		var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(file, jsonObj) {
			var external, userPath, str;
			return _regenerator2.default.wrap(function _callee5$(_context5) {
				while (1) {
					switch (_context5.prev = _context5.next) {
						case 0:
							external = new ThsExternal();
							_context5.next = 3;
							return external.getUserPath();

						case 3:
							userPath = _context5.sent;
							str = '';

							if (!(null === this.fos)) {
								_context5.next = 7;
								break;
							}

							return _context5.abrupt("return", false);

						case 7:
							_context5.next = 9;
							return this.fos.open(userPath + file);

						case 9:
							if (!_context5.sent) {
								_context5.next = 20;
								break;
							}

							_context5.prev = 10;
							_context5.next = 13;
							return this.fos.write(jsonObj);

						case 13:
							str = _context5.sent;
							_context5.next = 18;
							break;

						case 16:
							_context5.prev = 16;
							_context5.t0 = _context5["catch"](10);

						case 18:
							_context5.next = 20;
							return this.fos.close();

						case 20:
						case "end":
							return _context5.stop();
					}
				}
			}, _callee5, this, [[10, 16]]);
		}));

		function writeFileContent(_x5, _x6) {
			return _ref5.apply(this, arguments);
		}

		return writeFileContent;
	}(),

	/**
  * 获取预警结果条数
  */
	getAlertResultCount: function () {
		var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6() {
			return _regenerator2.default.wrap(function _callee6$(_context6) {
				while (1) {
					switch (_context6.prev = _context6.next) {
						case 0:
							_context6.next = 2;
							return this.clientUtil.getAlertResultCount();

						case 2:
							return _context6.abrupt("return", _context6.sent);

						case 3:
						case "end":
							return _context6.stop();
					}
				}
			}, _callee6, this);
		}));

		function getAlertResultCount() {
			return _ref6.apply(this, arguments);
		}

		return getAlertResultCount;
	}(),
	/**
  * 获取客户端预警提示声音
  * @param 返回结果: 预警声音的名称,不含后缀. 多个声音之间逗号隔开. 如"alert,向上,清脆"
  */
	getAlertSounds: function () {
		var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7() {
			return _regenerator2.default.wrap(function _callee7$(_context7) {
				while (1) {
					switch (_context7.prev = _context7.next) {
						case 0:
							_context7.next = 2;
							return this.clientUtil.getAlertSounds();

						case 2:
							return _context7.abrupt("return", _context7.sent);

						case 3:
						case "end":
							return _context7.stop();
					}
				}
			}, _callee7, this);
		}));

		function getAlertSounds() {
			return _ref7.apply(this, arguments);
		}

		return getAlertSounds;
	}(),
	/**
  * 删除预警结果
  * @param string moveStr 关闭对应的标识，格式为 "mobileid : xxx, pcid : xxx, mobileid : xxx, mobileid : xxx ,..." 只填非空的那一项id
  */
	moveSubResult: function () {
		var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(moveStr) {
			return _regenerator2.default.wrap(function _callee8$(_context8) {
				while (1) {
					switch (_context8.prev = _context8.next) {
						case 0:
							moveStr = moveStr || '';
							_context8.next = 3;
							return this.clientUtil.removeAlertResult(moveStr);

						case 3:
							return _context8.abrupt("return", _context8.sent);

						case 4:
						case "end":
							return _context8.stop();
					}
				}
			}, _callee8, this);
		}));

		function moveSubResult(_x7) {
			return _ref8.apply(this, arguments);
		}

		return moveSubResult;
	}(),

	/**
  * 设置默认预警方式
  * @param string
  */
	setDefaultAlertMode: function () {
		var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(modeStr) {
			return _regenerator2.default.wrap(function _callee9$(_context9) {
				while (1) {
					switch (_context9.prev = _context9.next) {
						case 0:
							_context9.next = 2;
							return this.clientUtil.setDefaultAlertMode(modeStr);

						case 2:
							return _context9.abrupt("return", _context9.sent);

						case 3:
						case "end":
							return _context9.stop();
					}
				}
			}, _callee9, this);
		}));

		function setDefaultAlertMode(_x8) {
			return _ref9.apply(this, arguments);
		}

		return setDefaultAlertMode;
	}(),
	/**
  * 获取默认预警方式
  * @param
  */
	getDefaultAlertMode: function () {
		var _ref10 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10() {
			return _regenerator2.default.wrap(function _callee10$(_context10) {
				while (1) {
					switch (_context10.prev = _context10.next) {
						case 0:
							_context10.next = 2;
							return this.clientUtil.getDefaultAlertMode();

						case 2:
							return _context10.abrupt("return", _context10.sent);

						case 3:
						case "end":
							return _context10.stop();
					}
				}
			}, _callee10, this);
		}));

		function getDefaultAlertMode() {
			return _ref10.apply(this, arguments);
		}

		return getDefaultAlertMode;
	}(),
	/**
  * 预警条件达到以后绑定事件
  * @param function fnName 方法名称
  */
	setRegisterAlertPush: function () {
		var _ref11 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee11(fnName) {
			return _regenerator2.default.wrap(function _callee11$(_context11) {
				while (1) {
					switch (_context11.prev = _context11.next) {
						case 0:
							fnName = fnName || '';
							if (fnName == '') {
								//return this._error(this.noenvironment);
							}
							_context11.next = 4;
							return this.clientUtil.registerAlertPush(fnName);

						case 4:
							return _context11.abrupt("return", _context11.sent);

						case 5:
						case "end":
							return _context11.stop();
					}
				}
			}, _callee11, this);
		}));

		function setRegisterAlertPush(_x9) {
			return _ref11.apply(this, arguments);
		}

		return setRegisterAlertPush;
	}(),

	/**
  * 关闭预警
  * @param string closeStr 关闭对应的标识，格式为 "mobileid : xxx, pcid : xxx, mobileid : xxx, mobileid : xxx ,..." 只填非空的那一项id
  */
	closeSub: function () {
		var _ref12 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee12(closeStr) {
			return _regenerator2.default.wrap(function _callee12$(_context12) {
				while (1) {
					switch (_context12.prev = _context12.next) {
						case 0:
							closeStr = closeStr || '';
							_context12.next = 3;
							return this.clientUtil.closeAlert(closeStr);

						case 3:
							return _context12.abrupt("return", _context12.sent);

						case 4:
						case "end":
							return _context12.stop();
					}
				}
			}, _callee12, this);
		}));

		function closeSub(_x10) {
			return _ref12.apply(this, arguments);
		}

		return closeSub;
	}(),

	/**
  * 打开预警
  * @param string openStr 关闭对应的标识，格式为 "mobileid : xxx, pcid : xxx, mobileid : xxx, mobileid : xxx ,..." 只填非空的那一项id
  */
	openSub: function () {
		var _ref13 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee13(openStr) {
			return _regenerator2.default.wrap(function _callee13$(_context13) {
				while (1) {
					switch (_context13.prev = _context13.next) {
						case 0:
							openStr = openStr || '';
							_context13.next = 3;
							return this.clientUtil.openAlert(openStr);

						case 3:
							return _context13.abrupt("return", _context13.sent);

						case 4:
						case "end":
							return _context13.stop();
					}
				}
			}, _callee13, this);
		}));

		function openSub(_x11) {
			return _ref13.apply(this, arguments);
		}

		return openSub;
	}(),

	/**
  * 删除预警
  * @param string delStr 删除对应的标识，格式为 "mobileid : xxx, pcid : xxx, mobileid : xxx, mobileid : xxx ,..." 只填非空的那一项id
  */
	delsubscribe: function () {
		var _ref14 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee14(delStr) {
			return _regenerator2.default.wrap(function _callee14$(_context14) {
				while (1) {
					switch (_context14.prev = _context14.next) {
						case 0:
							delStr = delStr || '';
							_context14.next = 3;
							return this.clientUtil.delAlertCfg(delStr);

						case 3:
							return _context14.abrupt("return", _context14.sent);

						case 4:
						case "end":
							return _context14.stop();
					}
				}
			}, _callee14, this);
		}));

		function delsubscribe(_x12) {
			return _ref14.apply(this, arguments);
		}

		return delsubscribe;
	}(),
	/**
  * 其他条件
  * @param string code
  * openAlertSetDlg(string)
  */
	openotherAlert: function () {
		var _ref15 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee15(code, market) {
			var options;
			return _regenerator2.default.wrap(function _callee15$(_context15) {
				while (1) {
					switch (_context15.prev = _context15.next) {
						case 0:
							code = code || '';
							market = market || '';
							options = { 'code': code, 'market': market };
							_context15.next = 5;
							return this.clientUtil.openAlertSetDlg(options);

						case 5:
							return _context15.abrupt("return", _context15.sent);

						case 6:
						case "end":
							return _context15.stop();
					}
				}
			}, _callee15, this);
		}));

		function openotherAlert(_x13, _x14) {
			return _ref15.apply(this, arguments);
		}

		return openotherAlert;
	}(),
	/**
  * 导出
  * @param int type 导出格式  0: excel 1.txt 2.剪贴板
  * @param string content 导出的内容
  */
	exportSubContent: function () {
		var _ref16 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee16(type, content) {
			var expertData;
			return _regenerator2.default.wrap(function _callee16$(_context16) {
				while (1) {
					switch (_context16.prev = _context16.next) {
						case 0:
							type = type || 0;
							content = content || '';
							expertData = { 'type': type, 'content': content };
							_context16.next = 5;
							return this.clientUtil.exportTo(expertData);

						case 5:
							return _context16.abrupt("return", _context16.sent);

						case 6:
						case "end":
							return _context16.stop();
					}
				}
			}, _callee16, this);
		}));

		function exportSubContent(_x15, _x16) {
			return _ref16.apply(this, arguments);
		}

		return exportSubContent;
	}(),

	/**
  * 修改窗口大小
  * @param int width 宽
  * @param int height 高
  * @param int moveStyle 框的位置
  */
	modifyWindowsSize: function modifyWindowsSize(width, height, moveStyle) {
		external.SetWindowRect({
			'width': width,
			'height': height,
			"moveStyle": "Center"
		});
	},
	/**
  * 修改窗口大小
  * @param int width 宽
  * @param int height 高
  */
	modifyWindowsSizeL: function modifyWindowsSizeL(width, height) {
		external.SetWindowRect({
			'width': width,
			'height': height
		});
	},
	/**
  * 打开老的预警界面
  * @param string code 股票代码
  */
	openAlertSetDlg: function () {
		var _ref17 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee17(code) {
			return _regenerator2.default.wrap(function _callee17$(_context17) {
				while (1) {
					switch (_context17.prev = _context17.next) {
						case 0:
							_context17.next = 2;
							return this.clientUtil.openAlertSetDlg(code);

						case 2:
							return _context17.abrupt("return", _context17.sent);

						case 3:
						case "end":
							return _context17.stop();
					}
				}
			}, _callee17, this);
		}));

		function openAlertSetDlg(_x17) {
			return _ref17.apply(this, arguments);
		}

		return openAlertSetDlg;
	}(),
	/**
  * 打开客户端公式
  * @param string pcid
  */
	modLocalAlertCfg: function () {
		var _ref18 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee18(pcid) {
			return _regenerator2.default.wrap(function _callee18$(_context18) {
				while (1) {
					switch (_context18.prev = _context18.next) {
						case 0:
							_context18.next = 2;
							return this.clientUtil.modLocalAlertCfg(pcid);

						case 2:
							return _context18.abrupt("return", _context18.sent);

						case 3:
						case "end":
							return _context18.stop();
					}
				}
			}, _callee18, this);
		}));

		function modLocalAlertCfg(_x18) {
			return _ref18.apply(this, arguments);
		}

		return modLocalAlertCfg;
	}(),
	/**
  * 设置预警结果为已读
  * @param string read
  */
	setAlertResultRead: function () {
		var _ref19 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee19(read) {
			return _regenerator2.default.wrap(function _callee19$(_context19) {
				while (1) {
					switch (_context19.prev = _context19.next) {
						case 0:
							_context19.next = 2;
							return this.clientUtil.setAlertResultRead(read);

						case 2:
							return _context19.abrupt("return", _context19.sent);

						case 3:
						case "end":
							return _context19.stop();
					}
				}
			}, _callee19, this);
		}));

		function setAlertResultRead(_x19) {
			return _ref19.apply(this, arguments);
		}

		return setAlertResultRead;
	}(),
	/**
  * 加入到板块
  * @param string codes 股票代码 多个股票之间用半角分号“;”分开
  */
	addCodeToBlock: function () {
		var _ref20 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee20(codes) {
			return _regenerator2.default.wrap(function _callee20$(_context20) {
				while (1) {
					switch (_context20.prev = _context20.next) {
						case 0:
							_context20.next = 2;
							return this.clientUtil.addCodeToBlock(codes);

						case 2:
							return _context20.abrupt("return", _context20.sent);

						case 3:
						case "end":
							return _context20.stop();
					}
				}
			}, _callee20, this);
		}));

		function addCodeToBlock(_x20) {
			return _ref20.apply(this, arguments);
		}

		return addCodeToBlock;
	}(),
	/**
  * 打开资讯弹窗
  * @param url,1
  */
	openURL: function () {
		var _ref21 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee21(url) {
			return _regenerator2.default.wrap(function _callee21$(_context21) {
				while (1) {
					switch (_context21.prev = _context21.next) {
						case 0:
							_context21.next = 2;
							return this.clientUtil.openURL(url, 1);

						case 2:
							return _context21.abrupt("return", _context21.sent);

						case 3:
						case "end":
							return _context21.stop();
					}
				}
			}, _callee21, this);
		}));

		function openURL(_x21) {
			return _ref21.apply(this, arguments);
		}

		return openURL;
	}(),

	/**
  * 打开预警设置的浏览器
  * @param string code 股票代码
  */
	openBrownSetSub: function () {
		var _ref22 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee22(code, market) {
			var options;
			return _regenerator2.default.wrap(function _callee22$(_context22) {
				while (1) {
					switch (_context22.prev = _context22.next) {
						case 0:
							code = code || '';
							market = market || '';
							options = { 'code': code, 'market': market };
							_context22.next = 5;
							return this.clientUtil.openAlertSetWebDlg(options);

						case 5:
							return _context22.abrupt("return", _context22.sent);

						case 6:
						case "end":
							return _context22.stop();
					}
				}
			}, _callee22, this);
		}));

		function openBrownSetSub(_x22, _x23) {
			return _ref22.apply(this, arguments);
		}

		return openBrownSetSub;
	}(),

	/**
  * 打开预警结果的浏览器
  * @param string code 股票代码
  */
	openBrownSubResult: function () {
		var _ref23 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee23(code) {
			return _regenerator2.default.wrap(function _callee23$(_context23) {
				while (1) {
					switch (_context23.prev = _context23.next) {
						case 0:
							_context23.next = 2;
							return this.clientUtil.openAlertResultWebDlg(code);

						case 2:
							return _context23.abrupt("return", _context23.sent);

						case 3:
						case "end":
							return _context23.stop();
					}
				}
			}, _callee23, this);
		}));

		function openBrownSubResult(_x24) {
			return _ref23.apply(this, arguments);
		}

		return openBrownSubResult;
	}(),
	/**
  * 打开问财预警
  * @param string code 股票代码
  */
	openAskEarlyWebDlg: function () {
		var _ref24 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee24(code) {
			return _regenerator2.default.wrap(function _callee24$(_context24) {
				while (1) {
					switch (_context24.prev = _context24.next) {
						case 0:
							_context24.next = 2;
							return this.clientUtil.openAskEarlyWebDlg(code);

						case 2:
							return _context24.abrupt("return", _context24.sent);

						case 3:
						case "end":
							return _context24.stop();
					}
				}
			}, _callee24, this);
		}));

		function openAskEarlyWebDlg(_x25) {
			return _ref24.apply(this, arguments);
		}

		return openAskEarlyWebDlg;
	}(),
	/**
  * 打开问财预警结果页面
  * @param string url
  */
	ShowDetailWebDlg: function () {
		var _ref25 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee25(url) {
			return _regenerator2.default.wrap(function _callee25$(_context25) {
				while (1) {
					switch (_context25.prev = _context25.next) {
						case 0:
							_context25.next = 2;
							return this.clientUtil.ShowDetailWebDlg(url);

						case 2:
							return _context25.abrupt("return", _context25.sent);

						case 3:
						case "end":
							return _context25.stop();
					}
				}
			}, _callee25, this);
		}));

		function ShowDetailWebDlg(_x26) {
			return _ref25.apply(this, arguments);
		}

		return ShowDetailWebDlg;
	}()

};